package test0109;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import java.util.Date;

public class Test03 {
    public static void main(String[] args) throws ParseException {
        // (3)计算100天之后的日期、计算今天距离过年还差多少天
        Date today = new Date();
        today.setTime(today.getTime()+(100L*24*60*60*1000));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        System.out.println(sdf.format(today));



        Date a = new Date();
        String b = "2025年01月29日";
        SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy年MM月dd日");
        Date c = sdf2.parse(b);
        System.out.println((c.getTime()-a.getTime())/1000/60/60/24);










//        LocalDate today = LocalDate.now();
//        LocalDate futureDate = today.plusDays(100);
//        LocalDate newYear = LocalDate.of(2025, 1, 29);
//        long daysBetween = ChronoUnit.DAYS.between(today, newYear);
//        System.out.println("100天之后的日期: " + futureDate);
//        System.out.println("天数差: " + daysBetween);
    }
}